<template>
  <l-side-nav :menu="sideMenu" />
</template>

<script setup lang="ts">
import { storeToRefs } from 'pinia'
import { computed } from 'vue'

import { MenuRoute } from '@renderer/types/interface'

import LSideNav from './SideNav.vue'
import { usePermissionStore } from '@renderer/store/modules/permission'

const permissionStore = usePermissionStore()
const { routers: menuRouters } = storeToRefs(permissionStore)

const sideMenu = computed(() => {
  const newMenuRouters = menuRouters.value as Array<MenuRoute>
  return newMenuRouters
})
</script>
